// 初始化轮播图的js代码
const mySwiper = new Swiper ('.swiper', {
    loop: true, // 循环模式选项
    autoplay: true,//自动播放
    // 如果需要分页器
    pagination: {
      el: '.swiper-pagination',
    },
    // 如果需要前进后退按钮
    navigation: {
      nextEl: '.swiper-button-next',
      prevEl: '.swiper-button-prev',
    }, 
  })  

  //2.助力行业巨头/ 独角兽企业
  let banks = document.querySelectorAll(".bank-1")
  let index = 0
  setInterval(function(){
    banks.forEach(function(v){
      v.style.opacity = 0
      v.style.zIndex = 1
    })
    index++
    banks[index].style.opacity = 1
    banks[index].style.zIndex = 10
    if(index>=banks.length-1){
      index=-1
    }
  },2000)

  // 3.一键回到顶部,滚动条滚动到300位置的时候，显示返回顶部按钮，小于隐藏
  let toTop = document.querySelector(".to-top")
  window.addEventListener("scroll",function(){
    // btn.addEventListener("click",function(){
    //   window.scrollTo(0,0)
    // })
    let y = window.scrollY
    if(y>=300){
      toTop.style.display = "block"
    }else{
      toTop.style.display = "none"
    }
    toTop.addEventListener("click",function(){
      window.scrollTo({
        top:0,
        behavior: "smooth"
      })
    })
  })
  